import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import javax.print.PrintService;
import javax.print.PrintServiceLookup;
import java.util.Arrays;
import java.util.stream.Collectors;

/**
 * @author
 * @version 1.0.0
 * @description
 * @createTime 2024/08/15
 */
@SpringBootApplication
public class GetPrinter {
    public static void main(String[] args) {

        PrintService[] printServices = PrintServiceLookup.lookupPrintServices(null, null);
        System.out.println(Arrays.stream(printServices).map(PrintService::getName).collect(Collectors.toList()));

        SpringApplication.run(GetPrinter.class, args);

        printServices = PrintServiceLookup.lookupPrintServices(null, null);
        System.out.println(Arrays.stream(printServices).map(PrintService::getName).collect(Collectors.toList()));

    }
}
